//
//  LJFStrategyCollectionViewCell.m
//  GiftThat
//
//  Created by 刘景峰 on 16/1/11.
//  Copyright © 2016年 ChuXiang. All rights reserved.
//

#import "LJFStrategyCollectionViewCell.h"

@implementation LJFStrategyCollectionViewCell
-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.myImageView = [[UIImageView alloc]initWithFrame:CGRectZero];
        [self addSubview:self.myImageView];
        
        self.bigLabel = [[UILabel alloc]initWithFrame:CGRectZero];
        self.bigLabel.textColor = [UIColor whiteColor];
        self.bigLabel.font = [UIFont systemFontOfSize:15];
        

        [self addSubview:self.bigLabel];
        
        
        
    }
    return self;
}

-(void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes{
    self.myImageView.frame = CGRectMake(5, 5, self.width - 10, self.height - 10);
    
    self.bigLabel.frame =  CGRectMake(10, self.height - 40, self.width, 40);
}


-(void)setNextModel:(LJFNextModel *)nextModel{
    if (_nextModel != nextModel) {
        _nextModel = nextModel;
    }
    
    [self.myImageView sd_setImageWithURL:[NSURL URLWithString:self.nextModel.cover_image_url] placeholderImage:[UIImage imageNamed:@"holder"]];
    
    self.bigLabel.text = self.nextModel.title;
    
    
}
@end
